package ro.gillardon.commons.mot.plane;

import java.time.LocalDateTime;

import ro.gillardon.commons.OfferDetails;
import ro.gillardon.commons.Price;
import ro.gillardon.commons.enums.City;
import ro.gillardon.commons.enums.Company;

/**
 * Holds the plane specific offer informations.
 *
 * @author ciolococ
 */
public class PlaneOfferDetails extends OfferDetails {

  /** The starting city. */
  private City from;

  /** The destination city. */
  private City to;

  /** The departure start date and time. */
  private LocalDateTime departStart;

  /** The departure end date and time. */
  private LocalDateTime departEnd;

  /** The return start date and time. */
  private LocalDateTime returnStart;

  /** The return end date and time. */
  private LocalDateTime returnEnd;

  /** The name of the airline. */
  private Company company;

  /** Constructor using fields. */
  public PlaneOfferDetails(final Price price, final City from, final City to, final LocalDateTime departStart,
    final LocalDateTime departEnd,
    final LocalDateTime returnStart, final LocalDateTime returnEnd, final Company company) {

    super(price);
    this.from = from;
    this.to = to;
    this.departStart = departStart;
    this.departEnd = departEnd;
    this.returnStart = returnStart;
    this.returnEnd = returnEnd;
    this.company = company;
  }

  /** Default constructor. */
  public PlaneOfferDetails() {
    // default constructor
  }

  /**
   * Gets the starting city of the flight.
   *
   * @return starting city name
   */
  public City getFrom() {
    return this.from;
  }

  /**
   * Sets the starting city of the flight.
   *
   * @param from : the new starting city for the flight
   */
  public void setFrom(final City from) {
    this.from = from;
  }

  /**
   * Gets the destination city of the flight.
   *
   * @return destination city name
   */
  public City getTo() {
    return this.to;
  }

  /**
   * Sets the destination city of the flight.
   *
   * @param to : the new destination city of the flight.
   */
  public void setTo(final City to) {
    this.to = to;
  }

  /**
   * Gets the depart start time and date.
   *
   * @return the depart start time and date
   */
  public LocalDateTime getDepartStart() {
    return this.departStart;
  }

  /**
   * Sets the depart start time and date.
   *
   * @param departStart : the new depart start time and date
   */
  public void setDepartStart(final LocalDateTime departStart) {
    this.departStart = departStart;
  }

  /**
   * Gets the depart end time and date.
   *
   * @return the depart end time and date
   */
  public LocalDateTime getDepartEnd() {
    return this.departEnd;
  }

  /**
   * Sets the depart end time and date.
   *
   * @param departEnd : the new depart end time and date
   */
  public void setDepartEnd(final LocalDateTime departEnd) {
    this.departEnd = departEnd;
  }

  /**
   * Gets the return start time and date.
   *
   * @return the return start time and date
   */
  public LocalDateTime getReturnStart() {
    return this.returnStart;
  }

  /**
   * Sets the return start time and date.
   *
   * @param returnStart : the new return start time and date
   */
  public void setReturnStart(final LocalDateTime returnStart) {
    this.returnStart = returnStart;
  }

  /**
   * Gets the return end time and date..
   *
   * @return the return end time and date
   */
  public LocalDateTime getReturnEnd() {
    return this.returnEnd;
  }

  /**
   * Sets the return end time and date.
   *
   * @param returnEnd : the new return end time and date.
   */
  public void setReturnEnd(final LocalDateTime returnEnd) {
    this.returnEnd = returnEnd;
  }

  /**
   * Gets the name of the airline company.
   *
   * @return the company
   */
  public Company getCompany() {
    return this.company;
  }

  /**
   * Sets the name of the airline company.
   *
   * @param company : the new company name
   */
  public void setCompany(final Company company) {
    this.company = company;
  }

  @Override
  public String toString() {
    return "PlaneOfferDetails [from=" + this.from + ", to=" + this.to + ", departStart=" + this.departStart
      + ", departEnd="
      + this.departEnd + ", returnStart=" + this.returnStart + ", returnEnd=" + this.returnEnd + ", company="
      + this.company + " , price=" + getPrice().toString() + "]";
  }

}
